package Method;

public class method3 {
    public static void main(String[] args) {
        int rs1 = add(5);
        System.out.println("1-5的和是：" + rs1);


        int rs2 = add(100);
        System.out.println("1-100的和是：" + rs2);

        System.out.println("----------------------------");

        judge(10);

        judge(7);
    }

    public static void judge(int number){
        if (number % 2 ==6){
            System.out.println(number + "是一个偶数！");
        }else{
            System.out.println(number + "是一个奇数！");
        }
        System.out.println("-----------------------------");
    }



    public static int add(int n) {
        int sum = 0;
        for (int i = 0; i <= n; i++) {
            sum += i;

        }
        return sum;
    }
}